Skip to content

feat(tree): validate YANG unique list constraints#448

Open
steiler wants to merge 1 commit into
mainfrom
feat/yang-unique-constraint
Open

feat(tree): validate YANG unique list constraints#448
steiler wants to merge 1 commit into
mainfrom
feat/yang-unique-constraint

Conversation

@steiler

@steiler steiler commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add validation_entry_unique.go: walks list children, collects leaf values per unique statement, reports violations
  • Wire into validation_dispatch.go and ValidationStats
  • Add test YANG schema (sdcio_model_list_unique.yang) covering single-leaf, multi-leaf composite, and descendant-path unique statements
  • Regenerate tests/sdcioygot/sdcio_schema.go with updated schema

Closes #445

Related

Implement unique constraint validation in the tree validation pipeline.
Reads UniqueConstraint entries from ContainerSchema, collects leaf
values across all list entries, and reports violations via
ValidationStats. Covers single-leaf, multi-leaf composite, and
descendant-path unique statements.

Co-authored-by: Cursor <cursoragent@cursor.com>
@steiler steiler force-pushed the feat/yang-unique-constraint branch from db96bc0 to 0b9a3ec Compare June 5, 2026 13:12
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.20792% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/tree/ops/validation/validation_entry_unique.go 82.10% 10 Missing and 7 partials ⚠️
pkg/config/validation.go 0.00% 2 Missing ⚠️
pkg/tree/types/validation_stats.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/schema/sdcio_model_list_unique.yang

@alexandernorth alexandernorth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement YANG unique list constraint at instance validation

2 participants